using System.Data.Entity.Migrations;
using System.Data.SQLite.EF6.Migrations;
using Comteck.Ktt.Services.SeedData;

namespace Comteck.Ktt.Services {
  /// <summary>
  /// 
  /// </summary>
  public sealed class MigratorConfiguration : DbMigrationsConfiguration<AppDbContext> {
    /// <summary>
    /// 
    /// </summary>
    public MigratorConfiguration() {
      this.AutomaticMigrationsEnabled = true;
      this.AutomaticMigrationDataLossAllowed = true; // 开发环境使用
      this.SetSqlGenerator("System.Data.SQLite", new SQLiteMigrationSqlGenerator());
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="context"></param>
    protected override void Seed(AppDbContext context) {
      new _20250429001_MenuAuth().Init(context);
      new _20250429001_Parameter().Init(context);
      new _20250429001_PrintTemplate().Init(context);
      new _20250429001_User().Init(context);
      new _20250401001().Init(context);
      new _20250401002_Index().Init(context);
      new _20250505001().Init(context);
      new _20250505010().Init(context);
      //new _20250112001_PrintTemplateGroupBySelfOrg().Init(context);
      //new _20250112002_ForceUpdatePrintTemplate().Init(context);

      // 可以在这里添加初始数据
      base.Seed(context);
    }
  }
}
